quartz: make test_resize () conform to coding style
authorKristian Rietveld <kris@loopnest.org>
Sun, 6 Nov 2011 08:33:50 +0000 (09:33 +0100)
committerKristian Rietveld <kris@lanedo.com>
Sun, 6 Nov 2011 09:16:27 +0000 (10:16 +0100)
gdk/quartz/gdkevents-quartz.c

index 3ef3e0f243e8e398700575db6b12e57df98b698a..9c8052188ba305fd23da1ed6ddc7971ad62ac26c 100644 (file)
@@ -1074,11 +1074,12 @@ test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
 {
   GdkWindowImplQuartz *toplevel_impl;
   gboolean lion;
+
   /* Resizing only begins if an NSLeftMouseButton event is received in
    * the resizing area. Handle anything else.
    */
   if ([event type] != NSLeftMouseDown)
-      return FALSE;
+    return FALSE;
 
   toplevel_impl = (GdkWindowImplQuartz *)toplevel->impl;
   if ([toplevel_impl->toplevel showsResizeIndicator])
@@ -1096,14 +1097,13 @@ test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
        * is too important to not make functional.
        */
       frame = [toplevel_impl->view bounds];
-      if (x > frame.size.width - GRIP_WIDTH
-         && x < frame.size.width
-         && y > frame.size.height - GRIP_HEIGHT
-         && y < frame.size.height)
-       {
-         return TRUE;
-       }
+      if (x > frame.size.width - GRIP_WIDTH &&
+          x < frame.size.width &&
+          y > frame.size.height - GRIP_HEIGHT &&
+          y < frame.size.height)
+        return TRUE;
      }
+
   /* If we're on Lion and within 5 pixels of an edge,
    * then assume that the user wants to resize, and
    * return NULL to let Quartz get on with it. We check
@@ -1111,14 +1111,12 @@ test_resize (NSEvent *event, GdkWindow *toplevel, gint x, gint y)
    * This extra check is in case the user starts
    * dragging before GDK recognizes the grab.
    */
-
-  lion = gdk_quartz_osx_version() >= GDK_OSX_LION;
+  lion = gdk_quartz_osx_version () >= GDK_OSX_LION;
   if (lion && (x < GDK_LION_RESIZE ||
-              x > toplevel->width - GDK_LION_RESIZE ||
-              y > toplevel->height - GDK_LION_RESIZE))
-    {
-      return TRUE;
-    }
+               x > toplevel->width - GDK_LION_RESIZE ||
+               y > toplevel->height - GDK_LION_RESIZE))
+    return TRUE;
+
   return FALSE;
 }
 
@@ -1228,8 +1226,9 @@ gdk_event_translate (GdkEvent *event,
   window = find_window_for_ns_event (nsevent, &x, &y, &x_root, &y_root);
   if (!window)
     return FALSE;
+
   /* Quartz handles resizing on its own, so we want to stay out of the way. */
-  if (test_resize(nsevent, window, x, y))
+  if (test_resize (nsevent, window, x, y))
     return FALSE;
 
   /* Apply any window filters. */